﻿using System.IO;

namespace ComicTool.Model
{
    public class FileInfoStrategy : LoadingStrategy
    {
        private FileInfo info;

        public FileInfoStrategy(FileInfo info)
        {
            this.info = info;
        }

        public override void BeginLoad()
        {
            Utility.Dispatcher.BeginInvoke(() =>
                {
                    OnComicLoadingProgress("Loading " + info.Name, null);
                });
            Stream = info.OpenRead();
            OnComicLoadingCompleted();
        }
    }
}
